package com.xinke.module.system.mapper.dict;

import java.util.*;

import com.xinke.component.common.pojo.PageResult;
import com.xinke.component.mybatis.mybatis.core.query.LambdaQueryWrapperExt;
import com.xinke.component.mybatis.mybatis.core.mapper.BaseMapperExt;
import com.xinke.module.system.model.entity.dict.DictTypeDO;
import org.apache.ibatis.annotations.Mapper;
import com.xinke.module.system.model.vo.dict.*;

/**
 * 字典类型 Mapper
 *
 * @author yzx
 */
@Mapper
public interface DictTypeMapper extends BaseMapperExt<DictTypeDO> {

    default PageResult<DictTypeDO> selectPage(DictTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperExt<DictTypeDO>()
                .likeIfPresent(DictTypeDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(DictTypeDO::getDictItem, reqVO.getDictItem())
                .eqIfPresent(DictTypeDO::getTypeStatus, reqVO.getTypeStatus())
                .eqIfPresent(DictTypeDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DictTypeDO::getDeletedTime, reqVO.getDeletedTime())
                .orderByDesc(DictTypeDO::getTypeId));
    }

}